package com.zhang.backend.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhang.backend.model.domain.User;
import com.zhang.backend.mapper.UserMapper;
import com.zhang.backend.model.vo.UserVO;
import com.zhang.backend.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.sql.Wrapper;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zyx
 * @since 2021-12-22
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public User login(UserVO userVO) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(User::getName, userVO.getUsername()).eq(User::getPassword, userVO.getPassword());
        return baseMapper.selectOne(wrapper);
    }

    @Override
    public void export(HttpServletResponse response, User user) {

    }

    @Override
    public Map<String, Object> importUser(MultipartFile file) {
        return null;
    }

    @Override
    public Object staByCollege() {
        return null;
    }
}
